package com.healthshare.parse.news;

import org.json.JSONException;
import org.json.JSONObject;

import com.palmedia.framework.parse.BaseParse;




/**
 * @author xudeliang
 * 文章解析
 */
public class ActicleParse extends BaseParse
{

	/*{
		　　“title”:”关于筷子的调查”,”
		"source":"39net",
		content”:”饮xxx食” ,
		"time":"2011-10-12:22:33"}

	*/
	public byte[] contentBuffer;
	public String title;
	public String source;
	public String time;
	public String content;
	public ActicleParse()
	{
		//JSONObject json = JSONObject.fromObject(null);  
	}
	
	
	@Override
	public boolean Parse(byte[]data)
	{
		boolean ret = super.Parse(data);
		if(!ret)
		{
			return false;
		}
		if(JSON==parseType)
		{
			try 
			{
				title = jsonObject.getString("title");
				source = jsonObject.getString("source");
				time = jsonObject.getString("time");
				content = jsonObject.getString("content");
				contentBuffer=data;
				return true;
			} 
			catch (JSONException e) 
			{
				e.printStackTrace();
			}
		}
		return false;
	}
	
}
